#ifndef SCREENUTILS_H
#define SCREENUTILS_H

#include <QObject>
#include <QImage>
#include <memory>
#include "ScreenImageProvider.h"

class ScreenUtils : public QObject
{
    Q_OBJECT

public:
    //static void Initialize(QObject* qmlRoot, QObject* parent = nullptr);
    //static ScreenUtils* Instance();

    ScreenUtils(QObject* parent = nullptr);
    ScreenImageProvider *provider;
signals:
    void image_update();
    void color_update(QColor);
public slots:
    void slot_capture();
    void slot_done(const int x, const int y);
    //QImage CaptureScreen();
    void onSelectColor(const int x, const int y);

    void slot_copy(QString val);
    void slot_copy(int r, int g, int b);
private:
    static std::shared_ptr<ScreenUtils> m_spInstance;

    QImage m_image;
    QObject* m_qmlRoot;
};

#endif // SCREENUTILS_H
